
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<div class="panel-body" style="padding-bottom: 0px; border-bottom: 0px;">
	
	<c:forEach items="${requestScope.cuxFlexFieldLineList}" var="data">
		<c:if test="${data.fieldAttributeType=='TEXT'}">
			<div class="form-group  row">
				<label class="col-sm-2 col-form-label">${data.fieldDesc}</label>
				<div class="col-sm-10">
					<input id="${data.fieldName}" name="${data.fieldName}" type="text" class="form-control" value="${requestScope.poHead.prepayAmount}">
				</div>
			</div>
			<div class="hr-line-dashed"></div>
		</c:if>
		
		<c:if test="${data.fieldAttributeType=='DATE'}">
			<div class="form-group  row">
				<label class="col-sm-2 col-form-label">${data.fieldDesc}</label>
				<div class="col-sm-10">
					<div class="input-group date">
						<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
						<input id="${data.fieldName}" name="${data.fieldName}" type="text" class="flexFieldDateClass form-control" value="<fmt:formatDate value="${requestScope.poHead.startDate}" pattern="yyyy-MM-dd"/>" autocomplete="off">
					</div>
				</div>
			</div>
			<div class="hr-line-dashed"></div>
		</c:if>
		
		<c:if test="${data.fieldAttributeType=='DATASET'}">
			<div class="form-group  row">
				<label class="col-sm-2 col-form-label">${data.fieldDesc}</label>
				<div class="col-sm-10">
					<select name="${data.fieldName}" id="${data.fieldName}" class="flexFieldDatasetClass form-control">
						<option value="" selected="">请选择</option>
						<c:forEach items="${data.fieldAttributeDatasetMap}" var="dataset">
                     		<option value="${dataset.key}">${dataset.value}</option>
                     	</c:forEach>
					</select>
				</div>
			</div>
			<div class="hr-line-dashed"></div>
		</c:if>
	</c:forEach>
	
</div>

<!-- select2 -->
<script src="js/plugins/select2/select2.full.min.js"></script>

<script>
$(document).ready(function(){
	//初始化select2
	$('.flexFieldDatasetClass').select2({width: "100%"});
	
	$('.flexFieldDateClass').datepicker({
		todayBtn : "linked",
		keyboardNavigation : true,
		forceParse : true,
		calendarWeeks : false,
		autoclose : true,
		format: 'yyyy-mm-dd',
		language: 'zh-CN',
	});
});
</script>